Google Hangouts
Create a space on Google Hangouts Chat
- Navigate to https://chat.google.com/ with your Google account.
- Click
New chatbutton and clickCreate a space - Inside the
Create a spacepop-up, add emoji (optional) and provide a name for the space. - Choose the space type as per your requirements:
- Collaboration: To collaborate on projects, plans, or topics and to easily share files, assign tasks, and organize your conversations by threads.
- Announcements: To broadcast and share updates with your group. Only space managers can post, manage permissions, and members. This cannot be changed after creation.
- Choose the space access settings as per your requirements and click
create.
Get the Google Hangouts Chat space webhook
- Click on the space name that you have just created and naviaget to
Apps & integrationsand clickWebhooks. - Now click
+ Add webhooksbutton:- Provide a name for the webhook and Avatar URL (optional).
- Click
Save.
- A webhook will be created and displayed under
Webhookssection of the same page. - Copy the webhook URL by cliking on
⋮andCopy link.
Setup Contact points on Grafana for Google Hangouts Chat
- Navigate to
Contact pointstab in theAlertingsection of the Grafana instance. - Click on
Add contact point, provide a name to the contact point and selectGoogle Hangouts Chatfrom theIntegrationdrop down. - Add the webhook URL you just copied under
URL. - To send a test alert to confirm whether the webhook works or not, you can click
Testto ensure the test alert is being sent to Google Hangouts Chat space. - Add the following snippet under the
Titleoption in theOptional Google Hangouts Chat settingssection:
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ if .CommonLabels.cluster }}[{{ .CommonLabels.cluster }}]{{ end }} {{ .CommonLabels.alertname }}
- Add the following snippet under the
Text Bodyoption in theOptional Google Hangouts Chat settingssection:
<b>Alert Details:</b>
{{- if .CommonLabels.alertname }}
- Alert Name: {{ .CommonLabels.alertname }}
{{- end }}
{{- if .CommonLabels.cluster }}
- Cluster: {{ .CommonLabels.cluster }}
{{- end }}
{{- if .CommonLabels.instance }}
- Instance: {{ .CommonLabels.instance }}
{{- end }}
{{- if .CommonLabels.job }}
- Job: {{ .CommonLabels.job }}
{{- end }}
{{- if .CommonLabels.namespace }}
- Namespace: {{ .CommonLabels.namespace }}
{{- end }}
{{- if .CommonLabels.node }}
- Node: {{ .CommonLabels.node }}
{{- end }}
{{- if .CommonLabels.pod }}
- Pod: {{ .CommonLabels.pod }}
{{- end }}
{{- if .CommonLabels.service }}
- Service: {{ .CommonLabels.service }}
{{- end }}
{{- if .CommonLabels.severity }}
- Severity: {{ .CommonLabels.severity }}
{{- end }}
<b>Annotations:</b>
{{- if .CommonAnnotations.description }}
- Description: {{ .CommonAnnotations.description }}
{{- end }}
{{- if .CommonAnnotations.summary }}
- Summary: {{ .CommonAnnotations.summary }}
{{- end }}
- You can also disable the resolve message [OK] that is sent when alerting state returns to false.
- Click
Save contact point
You can now use this contact point while setting [Notification Policies](../Notification Policies#vqM0m) for your alerts.